<?php
 $yhendus=new mysqli("localhost", "if13", "ifikad", "if13_paulamarie");
?>
<!doctype html>
<html>
 <head>
 <title>Ansamblid</title>
 </head>
 <body>
 <h1>Ansamblid</h1>
 <table>
 <?php
 $kask=$yhendus->prepare(
 "SELECT id, ansamblinimi, punktid, otsus FROM ansamblid1 WHERE avalik=1");
 $kask->bind_result($id, $ansamblinimi, $punktid, $otsus);
 $kask->execute();
 while($kask->fetch()){
 $ansamblinimi=htmlspecialchars($ansamblinimi);
 echo "<tr>
 <td>$ansamblinimi</td>
 <td>$punktid</td>
 <td>$otsus</td>
</tr>";
 }
 ?>
</table>
 </body>
</html>
<?php
 $yhendus->close();
?>
